package edu.java.texbooks.scjp.collections.test01;

public class MyObject extends Object {
	private String name = null;

	public MyObject(String name) {
		this.name = name;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Override
	public String toString() {
		return getName() + " object";

	}

	@Override
	public boolean equals(Object object) {

		return (object instanceof MyObject)
				&& ((MyObject) object).getName().equals(getName());
	}

	// @Override
	// public int hashCode() {
	//		
	// return name.hashCode();
	// }
}
